package com.jarvis.zeng.design.pattern.composite.factory;

public class TemplateFactory {

    @SuppressWarnings("unchecked")
    public static <T> T getFactory(String name){
        T obj = null;
        try{
            obj = (T)Class.forName(name).newInstance();
        }catch(Exception e){
            e.printStackTrace();
        }
        return obj;
    }

}
